import * as req from '@/request';

export async function list(
  params: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.DeployList>('/deploy/list',params,sorter,filter,);
}

export async function add(data: { [key: string]: any }) {
  return req.postJson<API.Result>('/deploy/create', data);
}

export async function remove(data: { key: string }) {
  return req.post<API.Result>('/deploy/delete', data);
}

export async function removes(data: { keys: string[] }) {
  return req.post<API.Result>('/deploy/deletes', data);
}

export async function redo(data: { keys: string[] }) {
  return req.post<API.Result>('/deploy/redo', data);
}

export async function recover(data: { keys: string[] }) {
  return req.post<API.Result>('/deploy/Recover', data);
}

export async function publishConfig(data: {keys: string[], must: boolean}) {
  return req.post<API.Result>('/deploy/PublishConfig', data);
}


export async function logs(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.post<API.DeployLogList>('/deploy/logs',params,sorter,filter,);
}

export async function removeLogs(data: {keys: any[]}) {
  return req.post<API.Result>('/deploy/deletelogs', data);
}





